#pragma once

#include "Type.h"
#include "DecoratedType.h"

class CPointerGeneralized;

//template type of  T*
class WHENGINE_API CPointerType: public CType
{

protected:
    CPointerType();
public:
    static CPointerType* GetStaticType();

    static CPointerGeneralized* FindPointerType(const SDecoratedType & ValueType);

    static CString CreateTypeName(const CString& ElementType);
    static STypeID CreateID(const SDecoratedType & ElementType);

protected:
    static CString PlaceholderName;

};


//type of T* 
//it's instance is a pointer to T*
class WHENGINE_API CPointerGeneralized : public CType
{
public:
    CPointerGeneralized(const SDecoratedType & InValueType);

    SDecoratedType  GetValueType() const;

    void* GetPointedObject(const void* InInstance);

    //create a instance(T**) with pointer to value(T*)
    void* CreateInstance(const void* InValuePtr);
};
